// components/OtherPageComponent.js
"use client";

import { useState } from "react";
import { useRouter } from "next/navigation";

const OtherPageComponent = () => {
  const router = useRouter();
  const [data, setData] = useState("Hello from CSR");

  const handleClick = () => {
    setData("Button Clicked on CSR Component!");
    router.push("/about"); // 跳转到关于页面
  };

  return (
    <div>
      <h2>这是一个只在客户端渲染的组件</h2>
      <p>{data}</p>
      <button onClick={handleClick}>点击我</button>
    </div>
  );
};

export default OtherPageComponent;
